package com.pi.fssm.base.web.rest;

import java.io.Serializable;

import org.apache.struts2.rest.HttpHeaders;

import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;



/**
 * 
 * Description:
 * REST基类
 * BaseController.java Create on 2013-4-21 下午8:46:51 
 * @author held
 * @version 1.0
 * Copyright (c) 2013 held,Inc. All Rights Reserved.
 */
 
public abstract class BaseController <T> implements ModelDriven<T>,  Serializable, Preparable{

	private static final long serialVersionUID = 3941891311558983326L;
	protected T entity;  
	  
	    /** 
	     * GET: /{model} 
	     */  
	    public abstract HttpHeaders index();  
	  
	    /** 
	     * POST: /{model} 
	     */  
	    public abstract HttpHeaders create();  
	  
	    /** 
	     * PUT: /{model}/{id} 
	     */  
	    public abstract String update();  
	  
	    /** 
	     * DELETE: /{model}/{id} 
	     */  
	    public abstract String destroy();  
	  
	    /** 
	     * GET: /{model}/{id} 
	     */  
	    public abstract HttpHeaders show();  
	  
	    /** 
	     * GET: /{model}/{id}/edit 
	     */  
	    public abstract String edit();  
	  
	    /** 
	     * GET: /{model}/new 
	     */  
	    public abstract String editNew();  
	  
	    @Override  
	    public T getModel() {  
	        return entity;  
	    }  
	  
	    /** 
	     * 子类通过重写此方法初始化实体类 
	     */  
	    @Override  
	    public abstract void prepare();  
	}  



